/**
 * 
 */
package vue;

import java.awt.Color;
import java.awt.Font;
import java.awt.LayoutManager;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import controleur.ControllerClient;

/**
 * @author Zayon
 *
 */
public class Panel_Louer extends JPanel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 806532019499809427L;
	private ControllerClient controller;
	private JTextField textField_nom;
	private JTextField textField_prenom;
	private JTextField textField_code_utilisateur;

	/**
	 * @wbp.parser.constructor
	 * 
	 */
	public Panel_Louer(ControllerClient p_ctrl) {
		controller = p_ctrl;
		setLayout(null);

		JLabel lblLouerUnVlo = new JLabel("Louer un V\u00E9lo");
		lblLouerUnVlo.setFont(new Font("Calibri", Font.BOLD, 20));
		lblLouerUnVlo.setForeground(Color.BLUE);
		lblLouerUnVlo.setBounds(46, 62, 154, 16);
		add(lblLouerUnVlo);

		JLabel lblInsrerVotreCarte = new JLabel("Ins\u00E9rer votre carte d'abonn\u00E9");
		lblInsrerVotreCarte.setBounds(30, 104, 196, 16);
		add(lblInsrerVotreCarte);

		textField_nom = new JTextField();
		textField_nom.setEditable(false);
		textField_nom.setBounds(95, 139, 154, 22);
		add(textField_nom);
		textField_nom.setColumns(10);

		JLabel lblNom = new JLabel("nom :");
		lblNom.setBounds(46, 145, 40, 16);
		add(lblNom);

		JLabel lblPrenom = new JLabel("prenom :");
		lblPrenom.setBounds(30, 180, 56, 16);
		add(lblPrenom);

		textField_prenom = new JTextField();
		textField_prenom.setEditable(false);
		textField_prenom.setColumns(10);
		textField_prenom.setBounds(95, 174, 154, 22);
		add(textField_prenom);

		textField_code_utilisateur = new JTextField();
		textField_code_utilisateur.setEditable(false);
		textField_code_utilisateur.setColumns(10);
		textField_code_utilisateur.setBounds(95, 209, 154, 22);
		add(textField_code_utilisateur);

		JButton btnLouer = new JButton("Louer");
		btnLouer.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				controller.louerVelo();
			}
		});
		btnLouer.setBounds(79, 241, 97, 25);
		add(btnLouer);

	}


	public void setTextFields(String prenom, String nom, int code_u) {
		textField_nom.setText(nom);
		textField_prenom.setText(prenom);
		textField_code_utilisateur.setText(""+code_u);
	}


	/****************************************************************************************/
	/****************************************************************************************/
	/****************************************************************************************/
	/**
	 * 
	 * @param layout
	 */
	public Panel_Louer(LayoutManager layout) {
		super(layout);
		// TODO Auto-generated constructor stub
	}

	/**
	 * @param isDoubleBuffered
	 */
	public Panel_Louer(boolean isDoubleBuffered) {
		super(isDoubleBuffered);
		// TODO Auto-generated constructor stub
	}

	/**
	 * @param layout
	 * @param isDoubleBuffered
	 */
	public Panel_Louer(LayoutManager layout, boolean isDoubleBuffered) {
		super(layout, isDoubleBuffered);
		// TODO Auto-generated constructor stub
	}
}
